#pragma once 

#include <memory>

namespace mms{
class MediaSource;
class MediaSink;
class MediaBridge: public std::enable_shared_from_this<MediaBridge>{
public:
    MediaBridge(const std::string& domain_name, const std::string& app_name, const std::string& stream_name);

    virtual ~MediaBridge() {}

    virtual bool init(std::weak_ptr<MediaSource> origin_source) = 0;

    virtual std::shared_ptr<MediaSource> get_media_source(){
        return source_;
    }

    virtual std::shared_ptr<MediaSink> get_media_sink(){
        return sink_;
    }

    virtual void close() = 0;

protected:
    std::weak_ptr<MediaSource> origin_source_;
    std::shared_ptr<MediaSource> source_;
    std::shared_ptr<MediaSink> sink_;

    std::string domain_name_;
    std::string app_name_;
    std::string stream_name_;
};

} // namespace mms